package sctu.edu.java.year2016.team01.renxinpeng.day20160610.chapter12_3;

import java.io.*;
import java.util.*;

/**
 * Created by Zero on 2016/6/12.
 */
public class Login {

    public void account(String name,String password) throws Exception{

        File file=new File("D:/","study.txt");
        Writer out = new FileWriter(file,true);
        String info="姓名："+name+"\n密码："+password;
        out.write(info.toCharArray());
        out.close();
    }


    public static void main(String[] args) throws Exception {


        Scanner scan = new Scanner(System.in);

        System.out.println("请用户输入姓名和密码：");
        System.out.println("姓名：");
        String name = scan.nextLine();


        System.out.println("密码：");
        String  password = scan.nextLine();


        Login login = new Login();
        login.account(name, password);
    }



}
